﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BenYueTS.aspx.cs" Inherits="Web.Pages.YongShui.BenYueTS" Theme="Default" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="../../../../JS/AddEditCancel.js"></script>
    <script type="text/javascript">

        //打开托收情况汇总
        function openGeneranize() {
            openCenter("/Pages/YongShui/5.ShouFeiGL/BenYueTSHZ.aspx?ym=" + encodeURI(txtconYM.GetText()), "600px", "595px");
        }
    </script>
    <script type="text/javascript">


        function search() {
            if (conText.GetText()=="")
            {
                return;
            }
            ASPxCallback1.PerformCallback("search");
        }
        function ASPxCallback1Complete(rs) {
            var arr = rs.split('|');
            var type = arr[0];
            var state = arr[1];
            var specialIdentity = arr[2];
            var msg = arr[3].split('-');
            LoadPanel.Hide();
            if (msg[0] == 'True') {
                alert(msg[1]);
            }
            hdCollection.Set("type", type);
            if (state == 'True') {
                if (type == "search") {
                    //存在记录, 跳至记录
                    gvList2.SetFocusedRowIndex(arr[4]);
                    gvList2.MakeRowVisible(arr[4]);
                }
            }
            else {
               
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div class="tabletitle1" align="center">
            本月托收
        </div>
        <dx:ASPxHiddenField ID="hdCollection" ClientInstanceName="hdCollection" runat="server"></dx:ASPxHiddenField>
        <dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){ASPxCallback1Complete(e.result);}"></dx:ASPxCallback>
        <dx:ASPxLoadingPanel ID="ASPxLoadingPanel1" ClientInstanceName="LoadPanel" runat="server"></dx:ASPxLoadingPanel>

        <asp:UpdatePanel ID="updatePanel1" runat="server">
            <ContentTemplate>
                <div class="top" style="width: 85%; margin: auto;">
                    <fieldset style="border: 1px solid  cornflowerblue; width: 98%; margin: auto;">
                        <legend style="font-weight: bold">汇总</legend>
                        <table>
                            <tr>
                                <td>数据年月：</td>
                                <td>
                                    <dx:ASPxTextBox ID="txtconYM" ClientInstanceName="txtconYM" runat="server" Width="80px">
                                        <ClientSideEvents KeyUp="function(s,e){inputNum(s);}" KeyPress="function(s,e){var key = event.keyCode;
                                        if( key==13){$('#btnconSearch').click();}}" />
                                    </dx:ASPxTextBox>
                                    <div style="display: none;">
                                        <dx:ASPxButton ID="btnconSearch" runat="server" Text="ASPxButton" OnClick="btnconSearch_Click" UseSubmitBehavior="false"></dx:ASPxButton>
                                    </div>
                                </td>
                                <td>管理块：</td>
                                <td>
                                    <dx:ASPxComboBox ID="cmbconGuanlik" ClientInstanceName="cmbconGuanlik" runat="server" ValueType="System.String" AutoPostBack="true" OnSelectedIndexChanged="cmbconGuanlik_SelectedIndexChanged">
                                    </dx:ASPxComboBox>
                                </td>
                                <td>
                                    <dx:ASPxButton ID="btnOpenGeranize" runat="server" Text="查看汇总" UseSubmitBehavior="false">
                                        <ClientSideEvents Click="function(s,e){openGeneranize();}" />
                                    </dx:ASPxButton>
                                </td>
                            </tr>
                        </table>
                        <dx:ASPxGridView ID="gvList1" runat="server" AutoGenerateColumns="False" KeyFieldName="I_SHOUFEIBH" Theme="Aqua1" Width="80%">
                            <Columns>
                                <dx:GridViewDataTextColumn FieldName="I_SHOUFEIBH" Caption="进帐单编号" Width="20%">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="I_ZONGBIS" Caption="总笔数" Width="20%">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="N_ZONGJINE" Caption="总金额" Width="30%">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="D_HEZHANGRQ" Caption="托收日期" Width="30%" PropertiesTextEdit-DisplayFormatString="yyyy-MM-dd">
                                </dx:GridViewDataTextColumn>
                            </Columns>
                            <Settings VerticalScrollableHeight="100" VerticalScrollBarMode="Auto" HorizontalScrollBarMode="Auto" />
                        </dx:ASPxGridView>
                    </fieldset>
                </div>
                <div style="width: 85%; text-align: center; margin: auto;">
                    <div style="height: 3px"></div>
                    <table>
                        <tr>
                            <td>
                                <dx:ASPxComboBox ID="cmbconGotoType" runat="server" ValueType="System.String">
                                </dx:ASPxComboBox>
                            </td>
                            <td>
                                <dx:ASPxTextBox ID="txtconYonghuh" ClientInstanceName="conText" runat="server" Width="170px" >
                                    <ClientSideEvents KeyPress="function(s,e){var key = event.keyCode;
                                        if( key==13){search();}}" />
                                </dx:ASPxTextBox>
                            </td>
                            <td>
                                <dx:ASPxButton ID="btnConGoto" runat="server" Text="定位" UseSubmitBehavior="false" AutoPostBack="false" ClientSideEvents-Click="function(s,e){search();}"></dx:ASPxButton>
                            </td>
                        </tr>
                    </table>
                    <div style="height: 3px"></div>
                    <dx:ASPxGridView ID="gvList2" ClientInstanceName="gvList2" runat="server" AutoGenerateColumns="False" KeyFieldName="I_TUOSHOUPZH" Theme="Aqua1" Width="100%">
                        <Columns>
                            <dx:GridViewDataTextColumn FieldName="I_TUOSHOUPZH" Caption="托收号码" Width="14%">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="S_YONGHUH" Caption="用户号" Width="14%">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="S_YONGHUM" Caption="用户名" Width="40%">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="I_YM" Caption="水量月" Width="12.5%">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="N_JINE" Caption="金额" Width="19.5%">
                            </dx:GridViewDataTextColumn>
                        </Columns>
                        <Settings VerticalScrollableHeight="260" VerticalScrollBarMode="Auto" HorizontalScrollBarMode="Auto" />
                    </dx:ASPxGridView>

                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>


